package com.lenovo.lcdm.dcm.common.enums;

/**
 * common response enum
 *
 * @author
 */
public enum BusinessMsgEnum {
    SUCCESS(200, "success"),
    FAIL(500, "fail"),
    // 1000-1010为dcm的报错信息
    DCM_NOT_EXIST(1001, "DCM does not exist."),

    OFFERING_NAME_AND_GEO_HAS_EXISTED(1002, "Product Offering Name is duplicated in same GEO."),

    DCM_HAS_BEEN_CHECKOUTED(1003, "DCM(number) is checked out by other users."),

    DCM_IS_NOT_LASTEST(1004, "DCM is not the latest version."),

    DCM_OFFERING_NAME_NOT_EXIST(1005, "Product Offering Name does not exist."),

    DCM_UNDOCHECKOUT_NEED_CHECKOUTBY(1006, "Not all selected items are checked out by current user."),

    DCM_UNDOCHECKOUT_ITEM_NOT_CHECKOUT(1007, "Selected item is not checked out. "),

    DCM_CTO_NUMBER_NOT_EXIST(1008, "CTO number does not exist."),

    DCM_NOT_GEO_EDITOR(1009, "Please add GEO Editor permissions first."),

    DCM_ID_IS_NULL(10010,  "Dcm id should not be null."),


    ;
    private int code;
    private String message;

    BusinessMsgEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    public String formatMsg(Object... args) {
        return String.format(getMessage(), args);
    }
}
